<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <div>
            <span v-on:click="fun(0)" >标题一</span>
            <span v-on:click="fun(1)" >标题二</span>
            <span v-on:click="fun(2)" >标题三</span>
        </div>
        <div>
            <ul v-if="index==0">
                <li>
                    11111111111111
                </li>
                <li>
                    11111111111111
                </li>
            </ul>
            <ul v-if="index==1">
                <li>22222222</li>
                <li>22222222</li>
            </ul>
            <ul v-if="index==2">
                <li>33333333</li>
                <li>3333333</li>
            </ul>
        </div>
    </div>
</body>
<script>
    let vm = new Vue({
        el: "#app",
        data: {
            index:''
        },
        methods: {
            fun(a){
                console.log(a)
                this.index=a
            }
        }
    })
</script>

</html>